<div class="layui-row layui-col-space15">
    <!--操作记录-->
    <div class="layui-col-md12 caozuojilu">
        <div class="table-box">
            <div class="title-list">
                操作记录
                <span class="title-icon"><i class="layui-icon layui-icon-down"></i></span>
            </div>
            <table class="layui-table table-list">
                <colgroup>
                    <col width="50">
                    <col width="180">
                    <col width="120">
                    <col width="100">
                    <col width="100">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>操作时间</th>
                    <th>动作</th>
                    <th>处理人</th>
                    <th>状态</th>
                    <th>说明</th>
                </tr>
                </thead>
                <tbody id="flowlog-tbody">
                </tbody>
            </table>
        </div>
    </div>
    <!--浏览记录-->
    <div class="layui-col-md12">
        <div class="table-box">
            <div class="title-list">
                浏览记录
                <span class="title-icon"><i class="layui-icon layui-icon-down"></i></span>
            </div>
            <div class="browse-list" id="reads-list">
                <div style="text-align: center;color: #aaa;width: 100%;margin-bottom:10px;">
                    <div><div><img style="width:70px;" src="/static/admin/images/welnodata.png" /></div><span>暂无数据</span></div>
                    <!-- 无数据 -->
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    function public_get_readsandlog(table, mid) {
        facade.ajax({url: ask_opt_get_readsandlog, data:{table:table,mid:mid}}).done(function(res){
            if (res.code === 2000) {
                let flowlog_str = '',reads_str = '';
                let flowlog = res.data.flowlog, reads = res.data.reads;
                for (let i=0; i<flowlog.length; i++){
                    let _num = parseInt(i + 1);
                    flowlog_str += '<tr>';
                    flowlog_str += '<td style="min-width: 10px">'+_num+'</td>';
                    flowlog_str += '<td>'+flowlog[i].created_at+'</td>';
                    flowlog_str += '<td>'+flowlog[i].name+'</td>';
                    flowlog_str += '<td>'+flowlog[i].created_user+'</td>';
                    flowlog_str += '<td>'+flowlog[i].statusname+'</td>';
                    flowlog_str += '<td>'+flowlog[i].explain+'</td>';
                    flowlog_str += '</tr>';
                }
                if(flowlog_str == ''){
                    flowlog_str += file_none(6);
                }
                file_assign('#flowlog-tbody', flowlog_str);


                for (let i=0; i<reads.length; i++){
                    let _num = parseInt(i + 1);
                    reads_str += '<div class="browse-box reads-tip-msg" tipmsg="'+reads[i].stotal+'次浏览，最后于'+reads[i].optdt+'">';

                    if(reads[i].avatar){
                        reads[i].avatar = get_file_complete(reads[i].avatar)
                    }else{
                        reads[i].avatar = "/static/admin/images/avatar.png";
                    }

                    reads_str += '<div class="browse-div"><img src="'+reads[i].avatar+'"></div>';
                    reads_str += '<div class="browse-div">'+reads[i].realname+'</div>';
                    reads_str += '</div>';
                }
                if(reads_str){
                    $('#reads-list').html(reads_str);
                }


            }
        });

    }


    var reads_layer_tips = 0;
    $(document).on('mouseenter', '.reads-tip-msg', function () {
        reads_layer_tips = layer.tips($(this).attr('tipmsg'), this, {time: 0});
    }).on('mouseleave', '.reads-tip-msg', function () {
        layer.close(reads_layer_tips);
    });
</script>


